/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2016 All Rights Reserved.
 */
package com.alipay.study.web.login;

import io.swagger.annotations.ApiOperation;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alipay.study.common.contact.security.SecurityWebContact;
import com.alipay.study.common.util.log.LogUtil;

/**
 * 
 * @author wb-qlj205528
 * @version $Id: LoginController.java, v 0.1 2016年11月10日 上午11:31:52 wb-qlj205528 Exp $
 */
@Controller
@RequestMapping(value = "/login")
public class LoginController {
    /**
     * 
     */
    private static final Logger LOGGER = Logger.getLogger(LoginController.class);

    /***
     * security contact
     */
    @Autowired
    private SecurityWebContact  securityWebContact;

    /**
     * 
     */
    @RequestMapping(value = "/login.json", method = { RequestMethod.POST })
    @ApiOperation(value = "spring security 设置的登录url", notes = "无任何意义，仅作为一个标示")
    private String loginJson(HttpServletRequest request) {

        return "/login/login";
    }

    /**
     * 
     */
    @RequestMapping(value = "/login.htm", method = { RequestMethod.POST, RequestMethod.GET })
    @ApiOperation(value = "spring security 设置的登录url测试", notes = "测试测试测试测试测试")
    private String login() {

        return "/login/login";
    }

    /**
     * 
     */
    @RequestMapping(value = "/loginsuccess", method = { RequestMethod.POST, RequestMethod.GET })
    @ResponseBody
    @ApiOperation(value = "登录成功跳转的url测试")
    private String loginsuccess() {

        LogUtil.info(LOGGER, "--------loginsuccess-------------");

        return "loginsuccess";
    }

    /**
     * 
     */
    @RequestMapping(value = "/logintest", method = { RequestMethod.POST, RequestMethod.GET })
    @ResponseBody
    @ApiOperation("登录请求测试")
    private String loginTest() {

        LogUtil.info(LOGGER, "--------logintest-------------");

        return "logintest";
    }
}
